<template>
  <div id="rose-chart">
    <div class="rose-chart-title">累计平台销售额分布</div>
    <dv-charts :option="option" />
  </div>
</template>

<script>
export default {
  name: 'RoseChart',
  props: {
    data: {
      type: Array,
      default: () => []
    }
  },
  data() {
    return {
      option: { }
    }
  },
  mounted() {
    setTimeout(() => {
      this.option = {
        series: [
          {
            type: 'pie',
            radius: '60%',
            data: this.data,
            outsideLabel: {
              formatter: '{name} {percent}%',
              labelLineEndLength: 20,
              style: {
                fill: '#fff'
              }
            },
            roseType: true
          }
        ]
      }
    }, 1000)
  }
}
</script>

<style lang="scss">
#rose-chart {
  width: 30%;
  height: 100%;
  background-color: rgba(6, 30, 93, 0.5);
  border-top: 2px solid rgba(1, 153, 209, .5);
  box-sizing: border-box;

  .rose-chart-title {
    height: 50px;
    font-weight: bold;
    text-indent: 20px;
    font-size: 20px;
    display: flex;
    align-items: center;
  }

  .dv-charts-container {
  }
}
</style>
